--! qt:dataset:srcpart
-- SORT_QUERY_RESULTS

EXPLAIN EXTENDED
SELECT * FROM (
  SELECT X.* FROM SRCPART X WHERE X.key < 100
  UNION ALL
  SELECT Y.* FROM SRCPART Y WHERE Y.key < 100
) A
WHERE A.ds = '2008-04-08'
SORT BY A.key, A.value, A.ds, A.hr;

SELECT * FROM (
  SELECT X.* FROM SRCPART X WHERE X.key < 100
  UNION ALL
  SELECT Y.* FROM SRCPART Y WHERE Y.key < 100
) A
WHERE A.ds = '2008-04-08'
SORT BY A.key, A.value, A.ds, A.hr;
